package test;

public class ChatterWindowThreadOpen extends Thread {
	ChatterWindows chatterWindows;
	boolean isBiger;

	public ChatterWindowThreadOpen(ChatterWindows chatterWindows,
			boolean isBigger) {
		super();
		this.chatterWindows = chatterWindows;
		this.isBiger = isBigger;
	}

	@Override
	public void run() {
		if (isBiger) {
			int width = chatterWindows.getWidth();
			int height = chatterWindows.getHeight();
			for (int i = width; i < 1250; i += 2) {
				chatterWindows.setSize(i, height);
				try {
					Thread.sleep(1);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		} else {
			int width = chatterWindows.getWidth();
			int height = chatterWindows.getHeight();
			for (int i = width; i > 800; i -= 2) {
				chatterWindows.setSize(i, height);
				try {
					Thread.sleep(1);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}

	}

}
